package com.wdc.simple.day04;

import java.util.ArrayList;
import java.util.Collections;

public class Main1 {
    public static void main(String[] args) {

        int x = 12321;
        boolean palindrome = isPalindrome(x);
        System.out.println(palindrome);
    }

    public static boolean isPalindrome(int x) {

        String  str = x + "";
        ArrayList<Character> list = new ArrayList<>();
        for (int i = 0; i < str.length(); i++) {
            list.add(str.charAt(i));
        }
        Collections.reverse(list);

        return str.equals(list.toString());
    }
}
